#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int main()
{
	typedef int shd;
	shd maxn = 0, maxi = 0, cnt = 0;
	char maxc;
	char c[105];
	scanf("%s", c);
	for (int i = 0; i < strlen(c); i++)
	{
		cnt = 1;
		for (int j = i + 1;; j++)
		{
			if (c[j] != c[i]) break;
			else cnt++;
		}
		if (cnt > maxn)
		{
			maxn = cnt;
			maxc = c[i];
			maxi = i;
		}
	}
	printf("%c %d %d", maxc, maxn, maxi);
}